package vip.xiaomoli.courier.model;

public class Result {

    public static final int SUCCESS = 1;

    public static final int FAILURE = -1;

    private int flag = SUCCESS;

    private String failMessage;

    private Result(){}

    private Result(int flag, String failMessage) {
        this.flag = flag;
        this.failMessage = failMessage;
    }

    public static Result success() {
        return new Result();
    }

    public static Result fail(String failMessage) {
        return new Result(FAILURE, failMessage);
    }

    public int getFlag() {
        return flag;
    }

    public String getFailMessage() {
        return null==failMessage ? "" : failMessage;
    }

}
